package cn.edu.neu.studentmsg_java.cons;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;

//用于传递json信息的自定义封装类
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
//自定义用于返回的json数据
public class R<T> implements Serializable {
    //错误码
    private Integer code;
    //错误信息
    private String msg;
    //数据（通过泛型来动态获取类型信息）
    private T data;
}
